package com.qili.service.exam.impl;

import com.qili.base.mapper.BaseMapper;
import com.qili.base.service.impl.BaseServiceImpl;
import com.qili.entity.base.BaseDict;
import com.qili.entity.exam.ExQuestion;
import com.qili.entity.exam.ExTree;
import com.qili.entity.exam.dto.ExQuestionDTO;
import com.qili.entity.it.Tree;
import com.qili.mapper.exam.ExQuestionMapper;
import com.qili.service.exam.ExQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author zhangshuo
 * @date 2021-05-08
 */
@Service
public class ExQuestionServiceImpl extends BaseServiceImpl<ExQuestion,String> implements ExQuestionService {

    @Autowired
    ExQuestionMapper exQuestionMapper;
    @Override
    public BaseMapper<ExQuestion, String> getMappser() {
        return exQuestionMapper;
    }

    @Override
    public int deleteProjectsFromRecycle(String[] ids) {
        return exQuestionMapper.deleteProjectsFromRecycle(ids);
    }

    /**
     * 查询试题库
     * @param ex
     * @return
     */
    @Override
    public List<ExQuestionDTO> selectExQuestion(ExQuestionDTO ex){
        return exQuestionMapper.selectExQuestion(ex);
    }

    /**
     * 树形根目录
     * @param tree
     * @return
     */
    @Override
    public List<ExTree> selectTree(ExTree tree){
        return exQuestionMapper.selectTree(tree);
    }
    /**
     * 查询第三级
     * @param tree
     * @return
     */
    @Override
    public List<ExTree> selectTrees(ExTree tree){
        return exQuestionMapper.selectTrees(tree);
    }

    /**
     * 新增试题分类
     * @param map
     * @return
     */
    @Override
    public int insertTree(Map map){
        return exQuestionMapper.insertTree(map);
    }

    /**
     * 修改试题分类
     * @param map
     * @return
     */
    @Override
    public int updateTree(Map map){
        return exQuestionMapper.updateTree(map);
    }

    /**
     * 批量删除（改状态）
     * @param map
     * @return
     */
    @Override
    public int deleteSts(Map map){
        return exQuestionMapper.deleteSts(map);
    }

    @Override
    public int hyAll(String[] ids) {
        return exQuestionMapper.hyAll(ids);
    }

    @Override
    public int deleteFromRecycle(String quId) {
        return exQuestionMapper.deleteFromRecycle(quId);
    }

    @Override
    public int hyAll(String id, String type) {
        return exQuestionMapper.hyAllN(id, type);
    }

    @Override
    public void deleteStsN(Map map) {
        exQuestionMapper.deleteStsN(map);
    }
}
